<?php

use App\Livewire\ChatComponent;
use App\Models\User;
use Illuminate\Container\Attributes\Auth;
use Illuminate\Support\Facades\Route;

Route::view('/', 'welcome');
Route::get('/dashboard', function () {
    $users = User::whereNot('id', auth()->id())->get();
    return view('dashboard', compact('users'));
})->middleware(['auth', 'verified'])->name('dashboard');

Route::get('/chat/{user_id}', function ($user_id) {
    return view('chat', compact('user_id'));
})->middleware(['auth', 'verified'])->name('chat');

Route::view('profile', 'profile')
    ->middleware(['auth'])
    ->name('profile');

require __DIR__ . '/auth.php';
